#ifndef LINK_STACK_H
#define LINK_STACK_H
#include <iostream>

template <class Object>
class Stack
{
  public:
  	Stack();
	Stack(const Stack &rhs);
	~Stack();

	bool isEmpty() const;
	bool isFull() const;
	const Object & top() const;

	void makeEmpty();
	void pop();
	void push(const Object &x);
	Object topAndPop();

	const Stack & operator=(const Stack &rhs);

  private:
  	struct ListNode
	{
		Object element;
		ListNode *next;

		ListNode(const Object &theElement, ListNode *n = NULL)
		  : element(theElement), next(n) { }
	};

	ListNode *topofStack;
};
#endif
